home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c,comp.lang.c++
- Path: cs.vu.nl!jalten
- From: jalten@cs.vu.nl (Alten JP)
- Subject: Re: New printf - like function, is it possible?
- Nntp-Posting-Host: kits.cs.vu.nl
- Followup-To: comp.lang.c,comp.lang.c++
- References: <4eqb3a$2r5@pan.otol.fi>
- Sender: news@cs.vu.nl
- Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
- Date: Thu, 1 Feb 1996 13:26:40 GMT
- X-Newsreader: TIN [version 1.2 PL2]
- Message-ID: <DM3MoH.Bu1.0.-s@cs.vu.nl>
-
- Timo Sakari (tkes@rhea.otol.fi) wrote:
-
- : Hi!
-
- [flipflap]
- : PrintToWin(DEBUG_WIN_1, "some stuff etc, %d, %f, %s, var1, var2, str1);
- : PrintToWin(OTHER_WIN, "anything that printf accepts");
-
- : So I want to print almost anything with this function without having
- : to write many functions to different argument types/number of arguments.
- : This should be possible in C++ (is it?), but is it possible in C ?
- : Can this be achieved by using void pointers and macros etc., or should
- : I give up and don't waste my time on this?
-
- Check out va_arg, va_end, va_start and va_list (stdarg.h)
- and search for ellipsis (...) in the help and in your C/C++
- documentation.
-
- Hope it helps,
-
- Jelle Paul
-
- --
- +-------------------------------------------------------+
- | Jelle Paul Alten | jalten@cs.vu.nl |
- | Vrije Universiteit Amsterdam | |
- +-------------------------------------------------------+
-